package com.mango.json;

import java.util.ArrayList;
import java.util.List;

public class ExcelDemo {
    //表头
    private List<List<String>> head;

    //表体
    private List<List<String>> body;

    public void setHead(List<ProductType> data) {
        ArrayList<List<String>> head = new ArrayList<>();
        ArrayList<String> sonHead = new ArrayList<>();

        //获取最高层级
        for (int i = 0; i < 10; i++) {
            sonHead.add("类目层级:" + i + 1);
        }
        head.add(sonHead);
        this.head = head;
    }

    public void setBody(List<ProductType> data) {
        List<List<String>> body = new ArrayList<>();
        //根据一个类目生成N行数据
        for (ProductType type : data) {
            body.addAll(toExcel(type));
        }
        this.body = body;
    }


    public List<List<String>> toExcel(ProductType productType) {
        List<List<String>> listList = new ArrayList<>();







        return null;
    }
}
